#pragma once

#include "../ConnectionLibrary.h"

#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/thread.hpp>

namespace AlgoTrading
{
	namespace ConnectionLibrary
	{

		class ClientConnectionLibraryImpl : public ClientConnectionLibrary
		{
		public:
			ClientConnectionLibraryImpl();

			void Start();
			void Stop();
			std::auto_ptr<FeedConnector> CreateFeedConnector(std::tr1::weak_ptr<NotificationHandler> notificationHandler);
			
		private:
			void ProcessingCycle();
			std::auto_ptr<boost::asio::io_service> io_service;
			std::auto_ptr<boost::thread> thread;
		};
	}
}